﻿using System.Linq;
using System.Web.Mvc;
using Enyim.Caching;
using SilenthinkContract;
using SilenthinkContract.Util;
using SilenthinkContract.Domain;

namespace Web.Manage.Controllers
{
    public class ProductCategoryController : BaseController
    {
        public ProductCategoryController(ILogService logService, IBaseService baseService, IExtraService extraService, IStoreService storeService, IOrderService orderService, IGameService gameService, IAuctionService auctionService, IPassportService passportService, IPaymentService paymentService, IMemcachedClient memcachedClient) : base(logService, baseService, extraService, storeService, orderService, gameService, auctionService, passportService, paymentService, memcachedClient)
        {
        }

        public ActionResult Index()
        {
            var model =StoreService.GetProductCategories().ToList();
            var tree = new TreeFactory<ProductCategory>().CreateTreeByLevel(model);

            return View(tree);
        }
        public ActionResult Create()
        {
            var model = new ProductCategory();
            return View(model);
        }
    }
}
